﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ResourceControl.ascx.cs" Inherits="UCWebpart.WebUserControl1" %>
<script src="jquery-1.4.3.js" type="text/javascript"></script>

<style type="text/css">
    .GridViewStyle
{   
    border-right: 2px solid #A7A6AA;
    border-bottom: 2px solid #A7A6AA;
    border-left: 2px solid black;
    border-top: 2px solid black;
    padding: 4px;
}

.GridViewStyle a
{
    color: #FFFFFF;
}

.GridViewHeaderStyle th
{
    border-left: 1px solid #EBE9ED;
    border-right: 1px solid #EBE9ED;
}

.GridViewHeaderStyle
{
    background-color: #5D7B9D;
    font-weight: bold;
    color: White;
}

.GridViewFooterStyle
{
    background-color: #5D7B9D;
    font-weight: bold;
    color: White;
}

.GridViewRowStyle
{
    background-color: #F7F6F3;
    color: #333333;
}

.GridViewAlternatingRowStyle
{
    background-color: #FFFFFF;
    color: #284775;
}

.GridViewRowStyle td, .GridViewAlternatingRowStyle td
{
    border: 1px solid #EBE9ED;
}

.GridViewSelectedRowStyle
{
    background-color: #E2DED6;
    font-weight: bold;
    color: #333333;
}

.GridViewPagerStyle
{
    background-color: #284775;
    color: #FFFFFF;
}

.GridViewPagerStyle table /* to center the paging links*/
{
    margin: 0 auto 0 auto;
}
</style>



            <asp:GridView ID="GridView1" CssClass="GridViewStyle" runat="server" AllowPaging="True" AllowSorting="True"
                 AutoGenerateColumns="False" DataSourceID="Entity_resourse" BorderColor="#999999" BorderStyle="None"
                OnSelectedIndexChanged="GridView1_SelectedIndexChanged" onroecancelingdit="GridView1_RowCancelingEdit" OnRowUpdating="GridView1_RowUpdating1" 
                RowCommand="GridView1_RowCommand" Width="100%" DataKeyNames="resId" OnRowCommand="GridView1_RowCommand1" OnPageIndexChanging="GridView1_PageIndexChanging1" BackColor="White" BorderWidth="1px" CellPadding="3" GridLines="Vertical">
                <FooterStyle CssClass="GridViewFooterStyle" BackColor="#CCCCCC" ForeColor="Black" />
                    <RowStyle CssClass="GridViewRowStyle" BackColor="#EEEEEE" ForeColor="Black" />   
                    <SelectedRowStyle CssClass="GridViewSelectedRowStyle" BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
                    <PagerStyle CssClass="GridViewPagerStyle" BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                    <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" BackColor="#DCDCDC" />
                    <HeaderStyle CssClass="GridViewHeaderStyle" BackColor="#000084" Font-Bold="True" ForeColor="White" />
                <Columns>   
                    <asp:TemplateField HeaderText="resId" SortExpression="resId">
                        <EditItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("resId") %>'></asp:Label>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("resId") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="resName" SortExpression="resName">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("resName") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("resName") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="resIcon" SortExpression="resIcon">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("resIcon") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("resIcon") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="resLastUser" SortExpression="resLastUser">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("resLastUser") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label4" runat="server" Text='<%# Bind("resLastUser") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="resLastTime" SortExpression="resLastTime">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("resLastTime") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label5" runat="server" Text='<%# Bind("resLastTime") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ShowHeader="False">
                        <EditItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update" Text="更新"></asp:LinkButton>
                            &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel" Text="取消"></asp:LinkButton>
                        </EditItemTemplate>
                        <HeaderTemplate>
                            <asp:Button ID="Button1" runat="server" CommandName="Insert" Text="Insert" />
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit" Text="编辑"></asp:LinkButton>
                            &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Select" Text="选择"></asp:LinkButton>
                            &nbsp;<asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="False" CommandName="Delete" Text="删除"></asp:LinkButton>
                        </ItemTemplate>
                        <ControlStyle BorderColor="#666699" ForeColor="#0099CC" />
                    </asp:TemplateField>
                </Columns>
                <EmptyDataTemplate>
                    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="resId" DataSourceID="EntityDataSource2" DefaultMode="Insert" Height="50px" OnPageIndexChanging="DetailsView1_PageIndexChanging" Width="125px" BackColor="White" BorderColor="#666699" BorderStyle="Solid">
                        <Fields>
                            <asp:BoundField DataField="resId" HeaderText="resId" ReadOnly="True" SortExpression="resId" />
                            <asp:BoundField DataField="resName" HeaderText="resName" SortExpression="resName" />
                            <asp:BoundField DataField="resIcon" HeaderText="resIcon" SortExpression="resIcon" />
                            <asp:BoundField DataField="resLastUser" HeaderText="resLastUser" SortExpression="resLastUser" />
                            <asp:BoundField DataField="resLastTime" HeaderText="resLastTime" SortExpression="resLastTime" />
                            <asp:CommandField ShowInsertButton="True" />
                        </Fields>
                    </asp:DetailsView>
                </EmptyDataTemplate>
                <SortedAscendingCellStyle BackColor="#F1F1F1" />
                <SortedAscendingHeaderStyle BackColor="#0000A9" />
                <SortedDescendingCellStyle BackColor="#CAC9C9" />
                <SortedDescendingHeaderStyle BackColor="#000065" />
            </asp:GridView>
            <asp:EntityDataSource ID="Entity_resourse" runat="server" ConnectionString="name=meetingroomManagementEntities" DefaultContainerName="meetingroomManagementEntities" EnableDelete="True" EnableFlattening="False" EnableInsert="True" EnableUpdate="True" EntitySetName="MTR_bas_Resources">
            </asp:EntityDataSource>
            <asp:EntityDataSource ID="EntityDataSource2" runat="server" ConnectionString="name=meetingroomManagementEntities" DefaultContainerName="meetingroomManagementEntities" EnableDelete="True" EnableFlattening="False" EnableInsert="True" EnableUpdate="True" EntitySetName="MTR_bas_Resources" OnSelecting="EntityDataSource2_Selecting">
            </asp:EntityDataSource>
            <asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=meetingroomManagementEntities" DefaultContainerName="meetingroomManagementEntities" EnableDelete="True" EnableFlattening="False" EnableInsert="True" EnableUpdate="True" EntitySetName="MTR_bas_Resources" EntityTypeFilter="MTR_bas_Resources" OnSelecting="EntityDataSource1_Selecting">
            </asp:EntityDataSource>



            
 
    <%--<asp:GridView ID="GridView2" runat="server"   onpageindexchanging="GridView1_PageIndexChanging"点击其他页时     

        AutoGenerateColumns="False"     CellPadding="4"  GridLines="None"   AllowPaging="True"

        AllowSorting="True"    onrowcancelingedit="GridView1_RowCancelingEdit 点击编辑后又点击取消时"        

        onrowdeleting="GridView1_RowDeleting 点击删除时" onrowediting="GridView1_RowEditing 点击编辑时"        

        onrowupdating="GridView1_RowUpdating 点击更新时" onsorting="GridView1_Sorting">

        <Columns> </Columns>

</asp:GridView>--%>





